<?php

class Member extends MY_Controller {

    function index() {
        $user = new User();
        $user->username = 'zYne-';
        $user->setPassword('password');
        $user->save();

        $userTable = Doctrine::getTable('User');
        $user = $userTable->findOneByUsername('zYne-');

        echo $user->username; // prints 'zYne-'

        $users = $userTable->retrieveAll();

        echo $users->count(); // echo '2''
        foreach ($users as $user) {
            echo $user->username;
        }
    }
    function add() {
        $this->layout->setLayout('theme1');
        $this->layout->css = array('myPage');
        $this->load->library('FormWidget2');
        $this->formwidget2->load('register','new_user'); // Relative to APPPATH/data/forms/, ".xml" appended
        if ($data = $this->formwidget2->post_data()) {
            print_r($data);
        }
        $this->layout->view('family/add',array('form'=> $this->formwidget2));
    }#end of function
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */